package com.meeting.meetingroom_api.repository;

import com.meeting.meetingroom_api.entity.Booking;
import com.meeting.meetingroom_api.entity.Payment;
import com.meeting.meetingroom_api.enums.PaymentStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface PaymentRepository extends JpaRepository<Payment, Integer>, JpaSpecificationExecutor<Payment> {

    Optional<Payment> findByBooking(Booking booking);
    Optional<Payment> findByBooking_BookingId(Integer bookingId);
    List<Payment> findByStatus(PaymentStatus status);
    Optional<Payment> findByTransactionId(String transactionId);
}